/**   
 * @Title: GPSListAdapter.java
 * @Package com.willter.weather.adapter
 * @Description: TODO(描述文件)
 * 		<p>
 * @author willter
 * @date 2012-9-13
 */
package com.willter.weather.adapter;

import com.willter.weather.app.R;

import android.content.Context;
import android.content.res.Resources;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

/**
 * @ClassName: GPSListAdapter
 * @Description: GPS自动搜索定位的适配器
 * 		<p>
 * @author willter
 * @date 2012-9-13
 */
public class GPSListAdapter extends BaseAdapter {

	private Context context;
	
	public GPSListAdapter(Context context) {
		this.context = context;
	}

	/** (非 Javadoc)
	 * @Title: getCount
	 * @Description: TODO(返回列表数目)
	 * 		<p>
	 * @author willter
	 * @date 2012-9-13
	 * 		<p>
	 * @return
	 * @see android.widget.Adapter#getCount()
	 */
	@Override
	public int getCount() {
		return 1;
	}

	/** (非 Javadoc)
	 * @Title: getItem
	 * @Description: TODO(根据列表索引值获取列表内容)
	 * 		<p>
	 * @author willter
	 * @date 2012-9-13
	 * 		<p>
	 * @param position
	 * @return
	 * @see android.widget.Adapter#getItem(int)
	 */
	@Override
	public Object getItem(int position) {
		Resources resource = context.getResources();
		return resource.getString(R.string.locale_city);
	}

	/** (非 Javadoc)
	 * @Title: getItemId
	 * @Description: TODO(获取元素ID)
	 * 		<p>
	 * @author willter
	 * @date 2012-9-13
	 * 		<p>
	 * @param position
	 * @return
	 * @see android.widget.Adapter#getItemId(int)
	 */
	@Override
	public long getItemId(int position) {
		return 0;
	}

	/** (非 Javadoc)
	 * @Title: getView
	 * @Description: TODO(获取列表视图)
	 * 		<p>
	 * @author willter
	 * @date 2012-9-13
	 * 		<p>
	 * @param position
	 * @param convertView
	 * @param parent
	 * @return
	 * @see android.widget.Adapter#getView(int, android.view.View, android.view.ViewGroup)
	 */
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			LayoutInflater layout = LayoutInflater.from(context);
			convertView = layout.inflate(R.layout.gps, null);
		}
		return convertView;
	}
}
